package top.ochiamalu.aioj.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import top.ochiamalu.aioj.enums.FavorTypeEnum;
import top.ochiamalu.aioj.strategy.favor.FavorStrategy;
import top.ochiamalu.aioj.strategy.favor.impl.QuestionFavorStrategy;
import top.ochiamalu.aioj.strategy.favor.impl.SetFavorStrategy;

import java.util.HashMap;
import java.util.Map;

/**
 * 点赞策略配置
 *
 * @author ochiamalu
 * @date 2025/03/07
 */
@Configuration
public class FavorStrategyConfig {

    @Bean
    public Map<FavorTypeEnum, FavorStrategy> favorStrategyMap(
            QuestionFavorStrategy questionFavorStrategy,
            SetFavorStrategy setFavorStrategy
    ) {
        Map<FavorTypeEnum, FavorStrategy> strategyMap = new HashMap<>();
        strategyMap.put(FavorTypeEnum.QUESTION, questionFavorStrategy);
        strategyMap.put(FavorTypeEnum.SET, setFavorStrategy);
        return strategyMap;
    }
} 